

//
//  UserInfoSave.m
//  ZQLearn
//
//  Created by macfeel on 2019/5/5.
//  Copyright © 2019 macfeel. All rights reserved.
//

#import "UserInfoSave.h"
#import "NSDictionary+DeleteNull.h"

@implementation UserInfoSave


+(instancetype)shareInstance{
    static UserInfoSave *_userModel = nil;
    static dispatch_once_t t;
    dispatch_once(&t,^{
        _userModel = [[UserInfoSave alloc]init];
    });
    return _userModel;
}

+ (NSDictionary*)mj_replacedKeyFromPropertyName

{
    
    return@{@"ID":@"id"};
    
}
///防止后台返回的字段不对应或多或少    引起的crash
-(void)setValue:(id)value forUndefinedKey:(nonnull NSString *)key{
    
    
}


+(void)saveUserInfoWithDic:(NSDictionary *)dic{
    
    //    NSDictionary *dict = [dic deleteNull];
    
//    [self saveData:dic];
    
}

+(void)cleanUserInfo{
    [self saveData:nil];
}

+ (void)saveData:(NSDictionary *)data{
    
    [[NSUserDefaults standardUserDefaults] setObject:[data deleteNull] forKey:kSaveUserInfoKey];
    YYLog(@"%@",[data deleteNull]);
    [[NSUserDefaults standardUserDefaults] synchronize];
    
}
@end
